﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserRightSetup.aspx.cs" Inherits="CSM.Views.Management.UserRightSetup" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
<script type="text/javascript" src="../../Js/jquery.js"></script>
<script src="../../Js/jquery.js" type="text/javascript"></script>
<script src="../../Js/jquery.autocomplete.min.js" type="text/javascript"></script> 
<script type="text/javascript" src="../../Js/thickbox.js"></script>
<link href="../../App_Themes/Default_1/jquery.autocomplete.css" type="text/css" rel="stylesheet"/> 
<link rel="stylesheet" href="../../App_Themes/Default_1/thickbox.css" type="text/css" media="screen" />
<script language="javascript" type="text/javascript">
    $(document).ready((function() {
        //由SERVER端获得
        $("#txtUser").autocomplete("GetData.ashx?database=TCsm_JS_User&which=UserName");
    }
));

//弹出模态窗体
function ShowThickBox(url,id,title) {
        var dir=url;
        var uid=id;
        imgLoader = new Image(); // preload image
        imgLoader.src = tb_pathToImage;
        window.tb_show(title, dir + "?userid=" + escape(uid) + "&height=300&width=450", ""); //Uid绑定需要弹出的DIV，后面要跟弹出窗体的高度及宽度
    };
    function closewind() { window.tb_remove(); };
    
    
    //AJAX显示当前操作员ID的权限列表。
    function fade() { $("#divResult").hide(); }
    function ShowDetail(olinkButton) {
        var id = olinkButton.innerText; ;
        var url = "GetUserRight.ashx?id=" + escape(id);
        var x = window.event.clientX + document.documentElement.scrollLeft;
        var y = window.event.clientY + document.documentElement.scrollTop;

        var fnCallBack = function(oResult) {
            var arr = new Array();
            arr = oResult.split('/');
            var oDivResult = document.getElementById("divResult");
            oDivResult.innerHTML = '';
            if (oDivResult) {
                for (var i = 0, len = arr.length; i < len; i++) {
                    oDivResult.innerHTML += '<font size=2 color = #efaa00>' + arr[i] + ' </font></br>';
                }
                oDivResult.style.display = "block";
                oDivResult.style.left = x;
                oDivResult.style.top = y;
            }
        }
        $.post(url, fnCallBack, null);

    }
   </script>
</head>
<body class = "CommonPage_Body">
    <form id="form1" runat="server">
        <table  >
        <tr><td><asp:TextBox ID="txtUser" runat="server" ></asp:TextBox></td><td><asp:Button ID="Button_Browse" runat="server" Text="查询" skinid="Button" 
                            onclick="Button_Browse_Click"/></td></tr>
            <tr>
                <td colspan="3">
                                               <asp:LinkButton ID="LinkButton_First" runat="server" CommandArgument="First" 
                            OnClick="MyClick" ><img src = "../../App_Themes/Default_1/Images/Page_First.gif" class = "Page_First"alt = "首页" /></asp:LinkButton>                
                        <asp:LinkButton ID="LinkButton_Prev" runat="server" CommandArgument="Prev" 
                            OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Prev.gif" class = "Page_Prev"  alt = "上页"/></asp:LinkButton>               
                        <asp:LinkButton ID="LinkButton_Next" runat="server" CommandArgument="Next" 
                            OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Next.gif"  class = "Page_Next"  alt = "下页"/></asp:LinkButton>                      
                        <asp:LinkButton ID="LinkButton_Last" runat="server" CommandArgument="Last" 
                            OnClick="MyClick"><img   src = "../../App_Themes/Default_1/Images/Page_Last.gif" class = "Page_Last" alt = "末页"/></asp:LinkButton>
                        <asp:Label ID="Label_Total" runat="server" Text="共："  SkinID="Label" ></asp:Label>
                        <asp:Label ID="Label_CurrenPageAndTo" runat="server" Text="页，当前第 页，转到"  SkinID="Label"></asp:Label>
                        <asp:TextBox ID="TextBox_PageIndex" runat="server" Width="26px"></asp:TextBox>
                        <asp:Label ID="Label4" runat="server" Text="页"  SkinID="Label"></asp:Label>
                        <asp:RangeValidator ID="RangeValidator_PageIndex" runat="server" ControlToValidate="TextBox_PageIndex"
                            ErrorMessage="*" MaximumValue="10000" MinimumValue="1" Type="Integer"></asp:RangeValidator>
                        <asp:Button ID="Button_PageGo" runat="server" CommandArgument="GotoPage" OnClick="MyClick"
                            Text="GO"  SkinID ="Button" />
                    <asp:GridView ID="GridView_Users" runat="server"  SkinID ="GridView" AutoGenerateColumns="False" OnRowDataBound="gv_OnRowBind">
                        <Columns>
                         <asp:TemplateField HeaderText="操作员ID">
                                    <ItemTemplate>
                                        <asp:Label ID="LinkButton1" runat="server" onmouseout="fade();" 
                                            onmouseover="ShowDetail(this);" Text='<%# Eval("UserID") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            <asp:BoundField DataField="UserName" HeaderText="操作员姓名" ReadOnly="True" 
                                SortExpression="UserName" />
                            <asp:TemplateField HeaderText="权限管理">
                                <ItemTemplate>
                               
                                 <asp:Button ID="Button1" runat="server"  SkinID ="Button" 
                                        CommandArgument='<%# Eval("UserID") %>' oncommand="Button_ShowDetailRight_Command" 
                                        Text="权限设置" />
                                <asp:Button ID="Button_ShowRolePage" runat="server"  SkinID ="Button" 
                                        CommandArgument='<%# Eval("UserID") %>' oncommand="Button_ShowRolePage_Command" 
                                        Text="角色设置" />
                                        <asp:Button ID="Button_ShowShopPage" runat="server"  SkinID ="Button" 
                                        CommandArgument='<%# Eval("UserID") %>' oncommand="Button_ShowShopPage_Command" 
                                        Text="店铺设置" />
                                <asp:Button ID="Button_ShowLevelPage" runat="server"  SkinID ="Button" 
                                        CommandArgument='<%# Eval("UserID") %>' oncommand="Button_ShowLevelPage_Command" 
                                        Text="等级设置" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                       
                    </td>
            </tr>
            <tr>
                <td>
                    <asp:HiddenField ID="CurrentPage" runat="server" Value="0" />
                      <div id="divResult"  style="border:1px dotted black ;width:100px;position:absolute;display:none;background-color:#fffaf3"></div>
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
<div id = "MyThickBox"></div>
    </form>
</body>
</html>
